﻿using ActionSystem.Core.Utils;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace ActionSystem.Input
{
    [PoolInit(typeof(GeneticPool<InputButton>),200)]
    public class InputButton : IPoolItem
    {
        private int index=0;
        public int Index { set { index = value; } get=>index; }
        private ButtonState state = ButtonState.Unkown;
        public ButtonState State { set { state = value; } get => state; }
        private Vector2 stick = Vector2.zero;
        public Vector2 Stick { set { stick = value; } get => stick; }
        public bool IsDeleted { get; set; }

        public void PoolItemDelete()
        {
            GeneticPool<InputButton>.Delete(this);
        }

        public void PoolItemReset()
        {
            index = 0;
            state = ButtonState.Unkown;
            stick = Vector2.zero;
        }

        public static InputButton Create()
        {
            return GeneticPool<InputButton>.Create();
        }
    }
}

